package com.confidena

import com.confidena.security.Person

class Game {
	String name
	String description
	Integer listSize
	Integer circleSize
	Integer creditSize
	Date creationDate
	Integer expirationTime //en horas
	
	static hasMany = [suscriptos: Person]

    static constraints = {
    }
	
	String toString() {
		"${name}"
	}
	
	def getPersonObjetive(){
		def total = 0
		for (int i = 1; i <= this.listSize; i++) {
			total = total + this.circleSize**i
		}
		return total
	}
	
	def getCreditObjetive(){
		return this.personObjetive * this.creditSize
	}
}
